//Original:/testcases/core/c_dsp32alu_rh_rnd20_m/c_dsp32alu_rh_rnd20_m.dsp
// Spec Reference: dsp32alu dreg (half)
# mach: bfin

.include "testutils.inc"
	start

imm32 r0, 0xa5678911;
imm32 r1, 0x2a89ab1d;
imm32 r2, 0x34a45515;
imm32 r3, 0x46a67717;
imm32 r4, 0x5678891b;
imm32 r5, 0x678aab1d;
imm32 r6, 0x7444a515;
imm32 r7, 0x86667a77;
R0.H = R0 - R0 (RND20);
R1.H = R0 - R1 (RND20);
R2.H = R0 - R2 (RND20);
R3.H = R0 - R3 (RND20);
R4.H = R0 - R4 (RND20);
R5.H = R0 - R5 (RND20);
R6.H = R0 - R6 (RND20);
R7.H = R0 - R7 (RND20);
CHECKREG r0, 0x00008911;
CHECKREG r1, 0xFD57AB1D;
CHECKREG r2, 0xFCB65515;
CHECKREG r3, 0xFB967717;
CHECKREG r4, 0xFA98891B;
CHECKREG r5, 0xF987AB1D;
CHECKREG r6, 0xF8BCA515;
CHECKREG r7, 0x079A7A77;

imm32 r0, 0xa5678911;
imm32 r1, 0x2789ab1d;
imm32 r2, 0xb4445515;
imm32 r3, 0x46667717;
imm32 r4, 0x5b78891b;
imm32 r5, 0x67bbab1d;
imm32 r6, 0x7444b515;
imm32 r7, 0x86667b77;
R0.H = R1 - R0 (RND20);
R1.H = R1 - R1 (RND20);
R2.H = R1 - R2 (RND20);
R3.H = R1 - R3 (RND20);
R4.H = R1 - R4 (RND20);
R5.H = R1 - R5 (RND20);
R6.H = R1 - R6 (RND20);
R7.H = R1 - R7 (RND20);
CHECKREG r0, 0x08228911;
CHECKREG r1, 0x0000AB1D;
CHECKREG r2, 0x04BC5515;
CHECKREG r3, 0xFB9A7717;
CHECKREG r4, 0xFA49891B;
CHECKREG r5, 0xF984AB1D;
CHECKREG r6, 0xF8BCB515;
CHECKREG r7, 0x079A7B77;

imm32 r0, 0xa5678911;
imm32 r1, 0x2a89ab1d;
imm32 r2, 0x3a445515;
imm32 r3, 0x46a67717;
imm32 r4, 0x567a891b;
imm32 r5, 0x6789ab1d;
imm32 r6, 0x74445a15;
imm32 r7, 0x866677a7;
R0.H = R2 - R0 (RND20);
R1.H = R2 - R1 (RND20);
R2.H = R2 - R2 (RND20);
R3.H = R2 - R3 (RND20);
R4.H = R2 - R4 (RND20);
R5.H = R2 - R5 (RND20);
R6.H = R2 - R6 (RND20);
R7.H = R2 - R7 (RND20);
CHECKREG r0, 0x094E8911;
CHECKREG r1, 0x00FCAB1D;
CHECKREG r2, 0x00005515;
CHECKREG r3, 0xFB967717;
CHECKREG r4, 0xFA98891B;
CHECKREG r5, 0xF987AB1D;
CHECKREG r6, 0xF8BC5A15;
CHECKREG r7, 0x079A77A7;

imm32 r0, 0xb5678911;
imm32 r1, 0xb789ab1d;
imm32 r2, 0x3d445515;
imm32 r3, 0x46d67717;
imm32 r4, 0x5678891b;
imm32 r5, 0x678ddb1d;
imm32 r6, 0x74445d15;
imm32 r7, 0x866677d7;
R0.H = R3 - R0 (RND20);
R1.H = R3 - R1 (RND20);
R2.H = R3 - R2 (RND20);
R3.H = R3 - R3 (RND20);
R4.H = R3 - R4 (RND20);
R5.H = R3 - R5 (RND20);
R6.H = R3 - R6 (RND20);
R7.H = R3 - R7 (RND20);
CHECKREG r0, 0x09178911;
CHECKREG r1, 0x08F5AB1D;
CHECKREG r2, 0x00995515;
CHECKREG r3, 0x00007717;
CHECKREG r4, 0xFA98891B;
CHECKREG r5, 0xF987DB1D;
CHECKREG r6, 0xF8BC5D15;
CHECKREG r7, 0x079A77D7;

imm32 r0, 0xd5678911;
imm32 r1, 0x2789ab1d;
imm32 r2, 0xd4445515;
imm32 r3, 0xd6667717;
imm32 r4, 0x5d78891b;
imm32 r5, 0x67d9ab1d;
imm32 r6, 0x744d5515;
imm32 r7, 0x8666dd77;
R0.H = R4 - R0 (RND20);
R1.H = R4 - R1 (RND20);
R2.H = R4 - R2 (RND20);
R3.H = R4 - R3 (RND20);
R4.H = R4 - R4 (RND20);
R5.H = R4 - R5 (RND20);
R6.H = R4 - R6 (RND20);
R7.H = R4 - R7 (RND20);
CHECKREG r0, 0x08818911;
CHECKREG r1, 0x035FAB1D;
CHECKREG r2, 0x08935515;
CHECKREG r3, 0x08717717;
CHECKREG r4, 0x0000891B;
CHECKREG r5, 0xF982AB1D;
CHECKREG r6, 0xF8BB5515;
CHECKREG r7, 0x079ADD77;

imm32 r0, 0xe5678911;
imm32 r1, 0x2e89ab1d;
imm32 r2, 0x34d45515;
imm32 r3, 0x46667717;
imm32 r4, 0x567d891b;
imm32 r5, 0x6789db1d;
imm32 r6, 0x74445d15;
imm32 r7, 0x866677d7;
R0.H = R5 - R0 (RND20);
R1.H = R5 - R1 (RND20);
R2.H = R5 - R2 (RND20);
R3.H = R5 - R3 (RND20);
R4.H = R5 - R4 (RND20);
R5.H = R5 - R5 (RND20);
R6.H = R5 - R6 (RND20);
R7.H = R5 - R7 (RND20);
CHECKREG r0, 0x08228911;
CHECKREG r1, 0x0390AB1D;
CHECKREG r2, 0x032B5515;
CHECKREG r3, 0x02127717;
CHECKREG r4, 0x0111891B;
CHECKREG r5, 0x0000DB1D;
CHECKREG r6, 0xF8BC5D15;
CHECKREG r7, 0x079A77D7;

imm32 r0, 0xa5678911;
imm32 r1, 0x2a89ab1d;
imm32 r2, 0x34a45515;
imm32 r3, 0x46a67717;
imm32 r4, 0x56a8891b;
imm32 r5, 0x678aab1d;
imm32 r6, 0x7444a515;
imm32 r7, 0x86667a77;
R0.H = R6 - R0 (RND20);
R1.H = R6 - R1 (RND20);
R2.H = R6 - R2 (RND20);
R3.H = R6 - R3 (RND20);
R4.H = R6 - R4 (RND20);
R5.H = R6 - R5 (RND20);
R6.H = R6 - R6 (RND20);
R7.H = R6 - R7 (RND20);
CHECKREG r0, 0x0CEE8911;
CHECKREG r1, 0x049CAB1D;
CHECKREG r2, 0x03FA5515;
CHECKREG r3, 0x02DA7717;
CHECKREG r4, 0x01DA891B;
CHECKREG r5, 0x00CCAB1D;
CHECKREG r6, 0x0000A515;
CHECKREG r7, 0x079A7A77;

imm32 r0, 0x15678911;
imm32 r1, 0x2789ab1d;
imm32 r2, 0x34445515;
imm32 r3, 0x46667717;
imm32 r4, 0x5678891b;
imm32 r5, 0x6789ab1d;
imm32 r6, 0x74445515;
imm32 r7, 0x86667777;
R0.H = R7 - R0 (RND20);
R1.H = R7 - R1 (RND20);
R2.H = R7 - R2 (RND20);
R3.H = R7 - R3 (RND20);
R4.H = R7 - R4 (RND20);
R5.H = R7 - R5 (RND20);
R6.H = R7 - R6 (RND20);
R7.H = R7 - R7 (RND20);
CHECKREG r0, 0xF7108911;
CHECKREG r1, 0xF5EEAB1D;
CHECKREG r2, 0xF5225515;
CHECKREG r3, 0xF4007717;
CHECKREG r4, 0xF2FF891B;
CHECKREG r5, 0xF1EEAB1D;
CHECKREG r6, 0xF1225515;
CHECKREG r7, 0x00007777;

imm32 r0, 0xe5678911;
imm32 r1, 0xe789ab1d;
imm32 r2, 0xe4445515;
imm32 r3, 0x4ee67717;
imm32 r4, 0x567e891b;
imm32 r5, 0x6789ab1d;
imm32 r6, 0x7444e515;
imm32 r7, 0x86667e77;
R6.H = R2 - R3 (RND20);
R1.H = R4 - R5 (RND20);
R5.H = R7 - R2 (RND20);
R3.H = R0 - R0 (RND20);
R0.H = R3 - R4 (RND20);
R2.H = R5 - R7 (RND20);
R7.H = R6 - R7 (RND20);
R4.H = R1 - R6 (RND20);
CHECKREG r0, 0xFA988911;
CHECKREG r1, 0xFEEFAB1D;
CHECKREG r2, 0x073C5515;
CHECKREG r3, 0x00007717;
CHECKREG r4, 0x005A891B;
CHECKREG r5, 0xFA22AB1D;
CHECKREG r6, 0xF956E515;
CHECKREG r7, 0x072F7E77;

imm32 r0, 0xe5678911;
imm32 r1, 0x2789ab1d;
imm32 r2, 0x3d445515;
imm32 r3, 0x46d67717;
imm32 r4, 0x567d891b;
imm32 r5, 0x6789db1d;
imm32 r6, 0x7444d515;
imm32 r7, 0x86667d77;
R3.H = R4 - R0 (RND20);
R1.H = R6 - R3 (RND20);
R4.H = R3 - R2 (RND20);
R6.H = R7 - R1 (RND20);
R2.H = R5 - R4 (RND20);
R7.H = R2 - R7 (RND20);
R0.H = R1 - R6 (RND20);
R5.H = R0 - R5 (RND20);
CHECKREG r0, 0x00EE8911;
CHECKREG r1, 0x06D3AB1D;
CHECKREG r2, 0x06AF5515;
CHECKREG r3, 0x07117717;
CHECKREG r4, 0xFC9D891B;
CHECKREG r5, 0xF996DB1D;
CHECKREG r6, 0xF7F9D515;
CHECKREG r7, 0x08057D77;

pass
